package com.wanmait.bootdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
//@RestController//等价于@Controller+@ResponseBody
public class HelloController {
    @RequestMapping("/hello")
    //@ResponseBody
    public void sayHello(String name, Model model){
        model.addAttribute("msg","hello "+name);
    }
}
